# 通过input()函数输入年龄，并转化为数字类型；
# 将年龄范围作为条件，用if...elif...else语句判断输入的年龄所处的阶段及可能遇到的考验；
# 用f字符串格式化打印年龄阶段及可能遇到的考验。

age = float(input("年龄："))

if 0 < age <= 1.5:
    stage,crisis,character = "婴儿期","基本信任与不信任的心理冲突","希望"
elif 1.5 < age <= 3:
    stage,crisis,character = "儿童期","自主与害羞和怀疑的冲突","意志力"
elif 3 < age <= 5:
    stage,crisis,character = "学龄初期","主动对内疚的冲突","目的"
elif 6 < age <= 12:
    stage,crisis,character = "学龄期","勤奋对自卑的冲突","能力"
elif 12 < age <= 18:
    stage,crisis,character = "青春期","自我同一性与角色混乱的冲突","忠诚"
elif 18 < age <= 25:
    stage,crisis,character = "成年早期","亲密对孤独的冲突","爱情"
elif 25 < age <= 65:
    stage,crisis,character = "成年期","繁衍对停滞的冲突","关心"
else:
    stage,crisis,character = "成熟期","自我整合与绝望期的冲突","睿智"

print(f"{age:.1f}岁所处的阶段是{stage}，面临的考验是{crisis}，如果度过考验获得的品质是{character}")
